<!-- <style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style> -->
<template src="./index.html"></template>
<script>
import Edit from "./../edit/index";
export default {
    mixins: [
        Vue.prototype.$vFN.Mixins.Base,
        Vue.prototype.$vFN.Mixins.Page,
        Vue.prototype.$vFN.Mixins.Table,
    ],
    data() {
        return {
            appWindow: window,
            // 页面接口地址
            apiUrl: {
                list: "mall-admin/platform-template/list",
            },
            // 表格查询数据
            mixinTable_tableSearchData: {
            },
            // 表格数据
            tableData: [],
            // 表格数据删除展示结构
            tableDeleteConfig: {
                columns: [
                    {
                        label: "菜单名称",
                        prop: "menuTitle",
                    },
                    {
                        label: "前端标识",
                        prop: "authName",
                        width: 300,
                    },
                    {
                        label: "菜单图标",
                        prop: "menuIcon",
                        type: "icon",
                    },
                    {
                        label: "菜单分类",
                        prop: "menuTypeMap.dictLabel",
                    },

                    {
                        label: "备注信息",
                        prop: "remark",
                    },
                ],
                // title: "确定停用以下内容么?",
            },

            // 数据字典
            // 菜单类型
            dict_menu_type: [],
        };
    },
    methods: {
        // 初始化
        async init() {
            this.mixinTable_refreshData();
            
        },

         // 通过
        async auditSuccess(id_) {
            this.$confirm("审核通过?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(async () => {
                    let _data = await this.$vFN.Http.post(
                        {
                            url: "mall-admin/platform-template/auditSuccess",
                            data: {
                                id: id_,
                            },
                        },
                        this.appWindow
                    );
                    if (_data._ok) {
                        this.$vFN.Tools.messageSuccess("审核通过");
                        this.init();
                    }
                })
                .catch(() => {});
        },
         // 拒绝
        async auditFail(id_) {
            this.$confirm("审核拒绝?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(async () => {
                    let _data = await this.$vFN.Http.post(
                        {
                            url: "mall-admin/platform-template/auditFail",
                            data: {
                                id: id_,
                            },
                        },
                        this.appWindow
                    );
                    if (_data._ok) {
                        this.$vFN.Tools.messageSuccess("已拒绝");
                        this.init();
                    }
                })
                .catch(() => {});
        },
    },
    mounted() {
        this.init();
    },
    activated() {},
};
</script>